package com.goldze.mvvmhabit.data.source.http.service;

import com.goldze.mvvmhabit.entity.DemoEntity;
import com.goldze.mvvmhabit.entity.LoginEntity;
import com.goldze.mvvmhabit.entity.PersonBody;

import io.reactivex.Observable;
import io.reactivex.Single;
import me.goldze.mvvmhabit.http.BaseResponse;
import okhttp3.MultipartBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * Created by goldze on 2017/6/15.
 */

public interface DemoApiService {
    @GET("action/apiv2/banner?catalog=1")
    Observable<BaseResponse<DemoEntity>> demoGet();

    @FormUrlEncoded
    @POST("action/apiv2/banner")
    Observable<BaseResponse<DemoEntity>> demoPost(@Field("catalog") String catalog);

    @POST("login")
    Observable<BaseResponse<DemoEntity>> demoLogin(@Body LoginEntity loginBody);
    //获取人员列表

    /**
     * pageNum=1&pageSize=10&isDelete=0&projectId=7
     *
     * @return
     */
    @GET("cs/person/list")
    Observable<BaseResponse<DemoEntity>> getPersonList(
            @Query("pageNum") int pageNum,
            @Query("pageSize") int pageSize,
            @Query("isDelete") int isDelete,
            @Query("projectId") long projectId
    );
    @Multipart
    @POST("system/user/profile/avatar")
    Single<BaseResponse> uploadFile(@Part MultipartBody.Part file);
}
